<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
//Vector categories = (Vector)pageContext.getAttribute("categorytree");
//Vector categories = (Vector)session.getAttribute("categorytree");
StringBuffer arrStr = new StringBuffer("");
				Vector arrVector = (Vector)session.getAttribute("categorytree");		
				if(0<arrVector.size()){
				  boolean isFirstKey = true;			
					for(int i=0;i<arrVector.size();i++){
						HashMap map = (HashMap)arrVector.get(i);
						Set temp = map.keySet();
						Iterator iter = temp.iterator();
						while(iter.hasNext()){
							if(isFirstKey){
								arrStr.append("\""+"categorytree" + "\":[{");
								isFirstKey = false;
							}
							String keyname = (String)iter.next();
							if(iter.hasNext()){
								arrStr.append("'"+keyname + "': '" + JspHelper.filterNull(map.get(keyname)) +"',");
							}else{
								arrStr.append("'"+keyname + "': '" + JspHelper.filterNull(map.get(keyname)) +"'}");
							}
						}
						if(i!=arrVector.size()-1){
							arrStr.append(",{");
						}
					}
					arrStr.append("]");
				}else{
					arrStr.append("\""+"categorytree" + "\":[]");
				}

			
			
		
out.print("{" + arrStr.toString() + "}");
//out.print("{" + arrVector + "}");
//out.print("{" + arrVector.size() + "}");



%>
